]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
swipe-scroll: Don't eat button-release events on click
authorFlorian Müllner <fmuellner@gnome.org>
Mon, 24 Jan 2011 21:31:10 +0000 (22:31 +0100)
committerFlorian Müllner <fmuellner@gnome.org>
Tue, 25 Jan 2011 09:31:52 +0000 (10:31 +0100)
The main overview group starts capturing events on button-press
events to implement swipe-scrolling. While reactive children of
the group which handle both button-press and button-release events
don't trigger swipe-scrolling, children that only rely on
button-release have stopped working - at least the primary/secondary
icons of the search entry are affected. While the capture handler
already checks the pointer movement between press and release to
determine whether the action should be considered a click rather
than a drag, it still blocks the release event from propagating.
Instead, only block release events for drag actions, but not for
clicks.

https://bugzilla.gnome.org/show_bug.cgi?id=640493

js/ui/overview.js

index 8f4e830fa1f28d54abc7faa86b3f9c58dc2d6c0c..c4b0c4ec0895ce9d9f13df5bc5404f611eb16863 100644 (file)
@@ -324,16 +324,17 @@ Overview.prototype = {
                         newValue += difference;
                 }
 
+                let result;
+
                 // See if the user has moved the mouse enough to trigger
                 // a drag
                 let threshold = Gtk.Settings.get_default().gtk_dnd_drag_threshold;
                 if (Math.abs(stageX - this._dragStartX) < threshold &&
                     Math.abs(stageY - this._dragStartY) < threshold) {
                     // no motion? It's a click!
-                    this.emit('swipe-scroll-end', SwipeScrollResult.CLICK);
+                    result = SwipeScrollResult.CLICK;
+                    this.emit('swipe-scroll-end', result);
                 } else {
-                    let result;
-
                     if (newValue == this._dragStartValue)
                         result = SwipeScrollResult.CANCEL;
                     else
@@ -362,7 +363,7 @@ Overview.prototype = {
                 global.stage.disconnect(this._capturedEventId);
                 this._capturedEventId = 0;
 
-                return true;
+                return result != SwipeScrollResult.CLICK;
 
             case Clutter.EventType.MOTION:
                 [stageX, stageY] = event.get_coords();